package joodle.ui;
/**
 * Represents the "Settings" action on the menu bar
 */
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;

import javax.swing.AbstractAction;
import javax.swing.JDialog;
import javax.swing.KeyStroke;

import joodle.si.ResourceManager;

@SuppressWarnings("serial")
public class SettingsAction extends AbstractAction {

	private JoodleFrame frame;
	
	public SettingsAction(JoodleFrame f) {
		super(ResourceManager.message("CHANGESETTINGS"), ResourceManager.makeIcon("settings"));
		putValue(MNEMONIC_KEY, KeyEvent.VK_T);
		putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke("control T"));
		
		this.frame = f;
	}
	/**
	 * @see AbstractAction#actionPerformed(ActionEvent)
	 */
	@Override
	public void actionPerformed(ActionEvent ae) {
		JDialog jd = new SettingsDialog(frame);
		jd.setVisible(true);
	}

}
